#ifndef _SNS_XIAONEI_ADAPTER_H_
#define _SNS_XIAONEI_ADAPTER_H_

#include <stdint.h>
#include <string>
#include <vector>
#include <map>

namespace sns {

namespace xiaonei {

struct UserProfile {
  // int32_t id;
  std::string id;
  std::string name;
  std::string tiny_url;
  std::string head_url;
};

class XiaoneiAdapter {
public:
  XiaoneiAdapter(const char * api_key, const char * secret_key)
      : api_key_(api_key), secret_key_(secret_key) {
  }

  std::vector<UserProfile> GetUserInfo(const std::string & session_key,
      const std::vector<std::string> & uids) const;

  std::vector<UserProfile> GetFriends(const std::string & session) const;
  std::vector<std::string> GetAppFriends(const std::string & session) const;

  static const XiaoneiAdapter & demo_app();
  static const XiaoneiAdapter & bigworld();
  static const XiaoneiAdapter & happy_farm();
private:
  std::string api_key_;
  std::string secret_key_;
  std::string CurlGet(const std::map<std::string, std::string> & post_args) const;
};

}
}

#endif // _SNS_XIAONEI_ADAPTER_H_
